package com.example.flower_shop.service;

import com.example.flower_shop.dto.review.ReviewDTO;
import com.example.flower_shop.dto.review.ReviewReplyDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ReviewService {
    // 评论相关
    ReviewDTO createReview(Long userId, Long productId, ReviewDTO reviewDTO, List<MultipartFile> images);

    ReviewDTO updateReview(Long userId, Long reviewId, ReviewDTO reviewDTO, List<MultipartFile> images);

    void deleteReview(Long userId, Long reviewId);

    Page<ReviewDTO> getProductReviews(Long productId, Pageable pageable);

    Page<ReviewDTO> getUserReviews(Long userId, Pageable pageable);

    // 评论回复相关
    ReviewReplyDTO createReply(Long userId, Long reviewId, ReviewReplyDTO replyDTO);

    ReviewReplyDTO updateReply(Long userId, Long replyId, ReviewReplyDTO replyDTO);

    void deleteReply(Long userId, Long replyId);

    Page<ReviewReplyDTO> getReviewReplies(Long reviewId, Pageable pageable);

    // 点赞相关
    void likeReview(Long userId, Long reviewId);

    void unlikeReview(Long userId, Long reviewId);

    void likeReply(Long userId, Long replyId);

    void unlikeReply(Long userId, Long replyId);

    // 统计相关
    Long getProductReviewCount(Long productId);

    Double getProductAverageRating(Long productId);

    void createReview(Long userId, Long productId, String orderNo, ReviewDTO reviewDTO);

    Page<ReviewDTO> getReviewsByProductId(Long productId, Pageable pageable);

    Page<ReviewDTO> getReviewsByUserId(Long userId, Pageable pageable);

    // 管理员评论相关
    Page<ReviewDTO> getAllReviews(String keyword, Integer status, String date, Pageable pageable);

    void deleteMerchantReview(Long reviewId);

    void updateReviewStatus(Long reviewId, Integer status);
}